﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="EnterPurchase.aspx.cs" Inherits="Auditors_EnterPurchase" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script>
        function GoTotxtDate() {
            var oEvent = window.event;
            if (oEvent.keyCode == 13 && !oEvent.ctrlKey) {


                $("#<%=txtDate.ClientID %>").focus();

            }
        }
        function GoTotxtAmount() {
            var oEvent = window.event;
            if (oEvent.keyCode == 13 && !oEvent.ctrlKey) {


                $("#<%=txtAmount.ClientID %>").focus();

            }
        }
        function GoTodropCurrency() {
            var oEvent = window.event;
            if (oEvent.keyCode == 13 && !oEvent.ctrlKey) {


                $("#<%=dropCurrency.ClientID %>").focus();

            }
        }

        function GoTotxtPONo() {
            var oEvent = window.event;
            if (oEvent.keyCode == 13 && !oEvent.ctrlKey) {


                $("#<%=txtPONo.ClientID %>").focus();

            }
        }

        function GoTotxtSupplier() {
            var oEvent = window.event;
            if (oEvent.keyCode == 13 && !oEvent.ctrlKey) {


                $("#<%=txtSupplier.ClientID %>").focus();

            }
        }

        function GoTotxtOffering() {
            var oEvent = window.event;
            if (oEvent.keyCode == 13 && !oEvent.ctrlKey) {


                $("#<%=txtOffering.ClientID %>").focus();

            }
        }

        function ButtonPostBack() {
            var oEvent = window.event;
            if (oEvent.keyCode == 13 && !oEvent.ctrlKey) {
                __doPostBack($("#<%=Button2.ClientID %>").attr("name"), '');
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        OnRowDataBound="GridView1_RowDataBound" DataKeyNames="id" 
        onrowdeleting="GridView1_RowDeleting">
        <Columns>
            <asp:BoundField DataField="VoucherNo" HeaderText="凭证" SortExpression="VoucherNo" />
            <asp:BoundField DataField="Date" HeaderText="日期" SortExpression="Date" />
            <asp:BoundField DataField="PONo" HeaderText="PONo" SortExpression="PONo" />
            <asp:BoundField DataField="Supplier" HeaderText="供应商" SortExpression="Supplier" />
            <asp:BoundField DataField="Offering" HeaderText="商品" SortExpression="Offering" />
            <asp:BoundField DataField="Amount" HeaderText="金额" SortExpression="Amount" />
            <asp:BoundField DataField="Currency" HeaderText="币种" SortExpression="Currency" />
            <asp:BoundField DataField="HKMoney" HeaderText="港币" SortExpression="HKMoney" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
    </asp:GridView>
    <table id="myTable">
        <tr>
            <th>
                凭证
            </th>
            <th>
                日期
            </th>
            <th>
                PONo
            </th>
            <th>
                供应商
            </th>
            <th>
                商品
            </th>
            <th>
                金额
            </th>
            <th>
                币种
            </th>
        </tr>
        <tr>
            <td>
                <asp:TextBox ID="txtVoucherNo" runat="server" onkeydown="GoTotxtDate();" Width="120px"></asp:TextBox>
            </td>
            <td>
                <asp:TextBox ID="txtDate" runat="server" onkeydown="GoTotxtPONo();" Width="120px"></asp:TextBox>
            </td>
            <td>
                <asp:TextBox ID="txtPONo" runat="server" onkeydown="GoTotxtSupplier();" Width="120px"></asp:TextBox>
            </td>
            <td>
                <asp:TextBox ID="txtSupplier" runat="server" onkeydown="GoTotxtOffering();" Width="120px"></asp:TextBox>
            </td>
            <td>
                <asp:TextBox ID="txtOffering" runat="server" onkeydown="GoTotxtAmount();" Width="120px"></asp:TextBox>
            </td>
            <td>
                <asp:TextBox ID="txtAmount" runat="server" onkeydown="GoTodropCurrency();" Width="120px"> </asp:TextBox>
            </td>
            <td>
                <asp:DropDownList ID="dropCurrency" runat="server" onkeydown="ButtonPostBack();">
                </asp:DropDownList>
            </td>
            <td style="display: none; width: 0px">
                <asp:Button ID="Button2" runat="server" UseSubmitBehavior="false" OnClick="Button2_Click" />
            </td>
        </tr>
    </table>
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" UseSubmitBehavior="false" />
    </div>
</asp:Content>
